package com.zy.service.impl;

import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import com.zy.entity.AiQuestion;
import com.zy.entity.DailyTask;
import com.zy.mapper.AiQuestionMapper;
import com.zy.mapper.DailyTaskMapper;
import com.zy.service.IAiQuestionService;
import com.zy.service.IDailyTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.List;

/**
 * @BelongsProject: SmartBidAI
 * @BelongsPackage: com.zy.service.impl
 * @Author: zhangyan
 * @CreateTime: 2025-09-05  18:40
 * @Description: TODO
 * @Version: 1.0
 */
@Service
public class DailyTaskServiceImpl extends ServiceImpl<DailyTaskMapper, DailyTask> implements IDailyTaskService {

    @Autowired
    private IAiQuestionService aiQuestionService;

    /**
     * 生成每日汇总
     */
    public void generateDailyReport(LocalDate date, String creator) {
        LocalDateTime startOfDay = date.atStartOfDay();
        LocalDateTime endOfDay = date.atTime(LocalTime.MAX);

        QueryWrapper queryWrapper = QueryWrapper.create();
        queryWrapper.where(AiQuestion::getCreateTime).between(startOfDay, endOfDay);
        // 查询当天问题
        List<AiQuestion> questions = aiQuestionService.list(queryWrapper);

    }
}
